<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>红梅食品</title>
  <style>
    /* 全局样式 */
    body {
      margin: 0;
      font-family: Arial, sans-serif;
    }

    /* 顶部导航 */
    header {
      background-color: #d00000;
      color: white;
      display: flex;
      align-items: center;
      width: auto;
      justify-content: space-between;
      padding: 0.5rem 1rem;
      position: relative;
    }

    header img {
      max-height: 50px;
    }

    /* 菜单按钮 */
    .menu-toggle {
      display: none;
      font-size: 1.5rem;
      background: none;
      border: none;
      color: white;
      cursor: pointer;
    }

    /* 导航菜单 */
    nav {
      display: flex;
      gap: 1rem;
    }

    nav a {
      color: white;
      text-decoration: none;
      font-size: 1rem;
    }

    nav a:hover {
      text-decoration: underline;
    }

    /* 移动端样式 */
    @media (max-width: 768px) {
      .menu-toggle {
        display: block;
      }

      nav {
        display: none;
        flex-direction: column;
        background-color: #d00000;
        position: absolute;
        top: 100%;
        right: 0;
        width: 100%;
        padding: 1rem 0;
      }

      nav a {
        padding: 0.5rem 1rem;
      }

      nav.active {
        display: flex;
      }
    }
  </style>
</head>
<body>
<header>
  <!-- Logo -->
  <img src="/src/img/logo.png"alt="红梅食品 Logo" style="max-height: 35px;>

  <!-- 菜单按钮（移动端可见） -->
  <button class="menu-toggle" onclick="toggleMenu()">☰</button>

  <!-- 导航菜单 -->
  <nav id="mobile-nav">
    <a href="#home">首页</a>
    <a href="#products">产品</a>
    <a href="#about">关于我们</a>
    <a href="#contact">联系我们</a>
  </nav>
</header>

<script>
  function toggleMenu() {
    const nav = document.getElementById('mobile-nav');
    nav.classList.toggle('active');
  }
</script>
</body>
</html>
